﻿using Clancy.Bl;
using Clancy.Bl.VideoProvider;
using Clancy.Interfaces;
using Clancy.Service.Client;
using Clancy.Ui;
using Clancy.Ui.Views;
using Ninject;
using System;
using System.Windows;

namespace Clancy2
{
    internal class Program
    {
        [STAThread]
        private static void Main(string[] args)
        {
            using (StandardKernel kernel = new StandardKernel())
            {
                RegisterServices(kernel);

                Application application = new Application();
                application.Resources.Add("Locator", kernel.Get<ViewModelLocator>());

                MainWindow mainWindow = kernel.Get<MainWindow>();
                application.Run(mainWindow);
                application.Shutdown();
            }
        }

        private static void RegisterServices(StandardKernel kernel)
        {
            kernel.Load<BlCatalog>();
            kernel.Load<UiModelCatalog>();
            kernel.Load<VideoProviderCatalog>();
            kernel.Load<ServiceClientCatalog>();
        }
    }
}